package com.hyh.feign.clients;
import com.hyh.feign.domain.Orders;
import com.hyh.feign.result.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(value = "orderservice")
public interface OrderClient {
    @Autowired

    @PostMapping("/api/order/createOrder/{id}")
    public Orders createOrder(@PathVariable("id") Long id,
                               @RequestParam(value = "orderNumber",required = false) String orderNumber);

    @PutMapping("/api/order/updateOrder/{id}")
    public PageResult updateOrder(@PathVariable("id") Long id);

    @GetMapping("/api/order/getOrderById/{id}")
    public Orders getOrderById(@PathVariable("id") Long id);

    @GetMapping("/api/order/existOrder/{id}")
    public boolean existOrder(@PathVariable("id") Long id);
}
